// JavaScript Document

//banner
(function(d, D, v) {
    d.fn.responsiveSlides = function(h) {
        var b = d.extend({
            auto: !0,
            speed: 1E3,
            timeout: 5E3,
            pager: !1,
            nav: !1,
            random: !1,
            pause: !1,
            pauseControls: !1,
            prevText: "Previous",
            nextText: "Next",
            maxwidth: "",
            controls: "",
            namespace: "rslides",
            before: function() {},
            after: function() {}
        },
        h);
        return this.each(function() {
            v++;
            var e = d(this),
            n,
            p,
            i,
            k,
            l,
            m = 0,
            f = e.children(),
            w = f.size(),
            q = parseFloat(b.speed),
            x = parseFloat(b.timeout),
            r = parseFloat(b.maxwidth),
            c = b.namespace,
            g = c + v,
            y = c + "_nav " + g + "_nav",
            s = c + "_here",
            j = g + "_on",
            z = g + "_s",
            o = d("<ul class='" + c + "_tabs " + g + "_tabs' />"),
            A = {
                "float": "left",
                position: "relative"
            },
            E = {
                "float": "none",
                position: "absolute"
            },
            t = function(a) {
                b.before();
                f.stop().fadeOut(q,
                function() {
                    d(this).removeClass(j).css(E)
                }).eq(a).fadeIn(q,
                function() {
                    d(this).addClass(j).css(A);
                    b.after();
                    m = a
                })
            };
            b.random && (f.sort(function() {
                return Math.round(Math.random()) - 0.5
            }), e.empty().append(f));
            f.each(function(a) {
                this.id = z + a
            });
            e.addClass(c + " " + g);
            h && h.maxwidth && e.css("max-width", r);
            f.hide().eq(0).addClass(j).css(A).show();
            if (1 < f.size()) {
                if (x < q + 100) return;
                if (b.pager) {
                    var u = [];
                    f.each(function(a) {
                        a = a + 1;
                        u = u + ("<li><a href='#' class='" + z + a + "'>" + a + "</a></li>")
                    });
                    o.append(u);
                    l = o.find("a");
                    h.controls ? d(b.controls).append(o) : e.after(o);
                    n = function(a) {
                        l.closest("li").removeClass(s).eq(a).addClass(s)
                    }
                }
                b.auto && (p = function() {
                    k = setInterval(function() {
                        var a = m + 1 < w ? m + 1 : 0;
                        b.pager && n(a);
                        t(a)
                    },
                    x)
                },
                p());
                i = function() {
                    if (b.auto) {
                        clearInterval(k);
                        p()
                    }
                };
                b.pause && e.hover(function() {
                    clearInterval(k)
                },
                function() {
                    i()
                });
                b.pager && (l.bind("click",
                function(a) {
                    a.preventDefault();
                    b.pauseControls || i();
                    a = l.index(this);
                    if (! (m === a || d("." + j + ":animated").length)) {
                        n(a);
                        t(a)
                    }
                }).eq(0).closest("li").addClass(s), b.pauseControls && l.hover(function() {
                    clearInterval(k)
                },
                function() {
                    i()
                }));
                if (b.nav) {
                    c = "<a href='#' class='" + y + " prev'>" + b.prevText + "</a><a href='#' class='" + y + " next'>" + b.nextText + "</a>";
                    h.controls ? d(b.controls).append(c) : e.after(c);
                    var c = d("." + g + "_nav"),
                    B = d("." + g + "_nav.prev");
                    c.bind("click",
                    function(a) {
                        a.preventDefault();
                        if (!d("." + j + ":animated").length) {
                            var c = f.index(d("." + j)),
                            a = c - 1,
                            c = c + 1 < w ? m + 1 : 0;
                            t(d(this)[0] === B[0] ? a: c);
                            b.pager && n(d(this)[0] === B[0] ? a: c);
                            b.pauseControls || i()
                        }
                    });
                    b.pauseControls && c.hover(function() {
                        clearInterval(k)
                    },
                    function() {
                        i()
                    })
                }
            }
            if ("undefined" === typeof document.body.style.maxWidth && h.maxwidth) {
                var C = function() {
                    e.css("width", "100%");
                    e.width() > r && e.css("width", r)
                };
                C();
                d(D).bind("resize",
                function() {
                    C()
                })
            }
        })
    }
})(jQuery, this, 0);
//phoneNav
$(function(){
	$('.phoNav').click(function(){
		if($(this).hasClass('active'), $('menu.phoneMenu').hasClass('active')){
			$(this).removeClass('active');
			$('menu.phoneMenu').removeClass('active');
		}
		else{
			$(this).addClass('active');
			$('menu.phoneMenu').addClass('active');
		}
	})
})
//screch
$(function(){
	if($(window).width()>1280){
		$('header section.headNav .form-fulis .search').hover(function(){
			if($(this).hasClass('active')){
				$(this).removeClass('active');
			}
			else{
				$(this).addClass('active');
			}
		})
	}else{
		$('header section.headNav .form-fulis .search').html('')
		let spans = $('<span class="iconfont">&#xe600;</span>')
		$('header section.headNav .form-fulis .search').append(spans)
		let is = 1
		$('header section.headNav .form-fulis .search').on('click',function(){
			if(is){
				$('.header section.headNav menu').slideDown()
				is = 0
			}else{
				$('.header section.headNav menu').slideUp()
				is = 1
			}
		})
	}
})
//number
 ;(function($){
$.fn.XNumber = function(numbers,blue){
	var Numbers = String(numbers);
	var Numlength = Numbers.length;
	var This = $(this);
	// 写入HTML
	if(This.html()){}else{
		// 创建移动滑块
		var Num = ['NumGe','NumShi','NumBai','NumQian','NumWan'];//个十百千万
		// html 变量
		var Numbox='',NumMax='';
		for(var i=0;i<10;i++){
			Numbox = Numbox+'<div class="Txt">'+i+'</div>';
		}
		for(var i=0;i<Numlength;i++){
			NumMax = NumMax+'<div class="'+Num[Numlength-1-i]+'">'+Numbox+'</div>';
		}
		This.append('<div class="NumContent">'+NumMax+'</div>');
	}
	//获取每个高
	$height = This.find('.Txt').height();
	//根据获取字符串长度 执行函数修改
	var numi = [];
	for(var i=0;i<Numlength;i++){
		numi[i] = Numbers.substring(i,i+1);
	}
	//判断blue值
	if(blue===true){
		for(var i=0;i<Numlength;i++){
			This.children('.NumContent').children().eq(i).css({'transform':'translateY('+-parseInt(numi[i])*$height+'px)'});
		}
	}else if(blue===false){
		This.children('.NumContent').children().css({'transform':'translateY(0px)'});
	}else{
		return false;
	}
}}(jQuery));
$(function(){
	$('.nub').eq(0).XNumber(17,true);
	$('.nub').eq(1).XNumber(4500,true);
	$('.nub').eq(2).XNumber(3,true);
	$('.nub').eq(3).XNumber(12,true);
})

function LinsFn(obj){
	if(obj==1){
		$('.IndexLContent>div').css({'top':'0','opacity':'0','display':'inline-block'});
		return false;
	}
	$('.IndexList ul li').each(function(){
		$this = $(this);
		$height = $this.find('.Txt').height();
		num = $this.find('em').html();
		$('.IndexLContent>div').css({'opacity':'1'})
		switch (num.length){
			case 0:
				break;
			case 1:
				numi = parseInt(num.substring(0,1));
				$this.find('.Sun').hide();
				$this.find('.Hun').hide();
				$this.find('.Ten').hide();
				$this.find('.Ind').css({'top':-numi*$height+'px'});
				break;
			case 2:
				numi = parseInt(num.substring(1,2));
				numt = parseInt(num.substring(0,1));
				$this.find('.Sun').hide();
				$this.find('.Hun').hide();
				$this.find('.Ten').css({'top':-numt*$height+'px'});
				$this.find('.Ind').css({'top':-numi*$height+'px'});
				break;
			case 3:
				numi = parseInt(num.substring(2,3));
				numt = parseInt(num.substring(1,2));
				numh = parseInt(num.substring(0,1));
				$this.find('.Sun').hide();
				$this.find('.Hun').css({'top':-numh*$height+'px'});
				$this.find('.Ten').css({'top':-numt*$height+'px'});
				$this.find('.Ind').css({'top':-numi*$height+'px'});
				break;
		    case 4:
		    	nums = parseInt(num.substring(3,4));
				numi = parseInt(num.substring(2,3));
				numt = parseInt(num.substring(1,2));
				numh = parseInt(num.substring(0,1));
				$this.find('.Sun').css({'top':-nums*$height+'px'});
				$this.find('.Hun').css({'top':-numh*$height+'px'});
				$this.find('.Ten').css({'top':-numt*$height+'px'});
				$this.find('.Ind').css({'top':-numi*$height+'px'});
				break;
		}
	});

}

//xk
$(function(){
  $(".maxins .subattr .attractions:gt(0)").hide()
	$(".maxins aside a").click(function(){
	 $(this).addClass("on").siblings().removeClass("on");
		var index=$(this).index();
		$(".maxins .subattr .attractions").eq(index).show().siblings().hide();
			})
});

//xk
$(function(){
  $("section.page3 .page3Rit .ourTeam:gt(0)").hide()
	$("section.page3 .page3Lft .team li").click(function(){
	 $(this).addClass("on").siblings().removeClass("on");
		var index=$(this).index();
		$("section.page3 .page3Rit .ourTeam").eq(index).show().siblings().hide();
  })
});

//maps
$(function(){
  $('section.page4 .page4Rit .mapList li small').hover(function(){
  	if($(this).parent().hasClass('active')){
  		$(this).parent().stop().removeClass('active')
  	}else{
  		$(this).parent().stop().addClass('active')
  	}
  })
});
//xkk
$(function(){
     $("section.page4 .ourList").eq(0).addClass('xs');
     $("section.page4 .page4Rit .mapList li").click(function(){
		 $(this).addClass("on").siblings().removeClass("on");
	 	 var index=$(this).index();
		 $("section.page4 .ourList").eq(index).addClass('xs').siblings().removeClass('xs');
     })
})


//shits
$(function(){
	var indx = $('div.sliderBox .swiper-slide')
	var inds = $('div.ourhistory .swiper-slide');
	var This;
	function Animate(){
	   indx.eq(This.index()).addClass('swiper-slide-active').siblings().removeClass('swiper-slide-active ');
	   inds.eq(This.index()).addClass('swiper-slide-active').siblings().removeClass('swiper-slide-active ');
	}
	indx.click(function(){
	   This=$(this);
	   Animate();
	})
	inds.click(function(){
	   This=$(this);
	   Animate();
	});

	$('div.hdm .swiper-button-next').click(function(){
		 $('.hg2').click();
			_this = $(this);
			if(_this.attr('class')=='swiper-button-next'){
				Current = $('div.hdm .swiper-slide.swiper-slide-active');
				$('div.hdm .swiper-wrapper').find('.swiper-slide').eq(swiper-slide-active.index()+1).addClass('swiper-slide-active').siblings('.swiper-slide').removeClass('swiper-slide-active');
				}else{
				return;
          }
	});
	$('div.hdm .swiper-button-prev').click(function(){
		 $('.hg1').click();
		_this = $(this);
		if(_this.attr('class')=='swiper-button-prev'){
			Current = $('div.hdm .swiper-slide.swiper-slide-active');
			$('div.hdm .swiper-wrapper').find('.swiper-slide').eq(swiper-slide-active.index()-1).addClass('swiper-slide-active').siblings('.swiper-slide').removeClass('swiper-slide-active');

		}else{
				return;
		}
  })
});










